<script lang="ts" setup>
import { defineEmits, defineProps, withDefaults } from "vue";
const emits = defineEmits<{
  (e: "changeUrl", url: string, title: string): void;
}>();
interface Props {
  urlPath: { path: string; title: string }[];
}
const props = withDefaults(defineProps<Props>(), { urlPath: [] as any });
</script>
<template>
  <el-card style="max-width: 480px">
    <template #header>
      <div class="card-header">
        <span>用户名</span>
      </div>
    </template>
    <div v-for="url in props.urlPath" :key="url.title">
      <router-link
        :to="{ path: url.path }"
        @click="emits('changeUrl', url.path, url.title)"
      >
        {{ url.title }}
      </router-link>
    </div>
  </el-card>
</template>
